Skip to content

Instantly share code, notes, and snippets.

Chris chrisdugne

Block or report user

Report or block chrisdugne

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chrisdugne
chrisdugne / spirit.lua
Created Apr 8, 2019
Demo corona spritesheet animation
View spirit.lua
local Spirit = {}
local idle = {
name = 'idle/18',
frames = {
{x = 0, y = 0, width = 111,height = 172},
{x = 111, y = 0, width = 111,height = 172},
{x = 222, y = 0, width = 111,height = 172},
{x = 0, y = 172,width = 111,height = 172},
{x = 111, y = 172,width = 111,height = 172},
View drop-shadow-snaphot.lua
local cardW = W * 0.9
local cardH = 250
local SR = 3 -- shadow radius
local SA = 0.4 -- shadow alpha
local card = display.newGroup()
options.parent:insert(card)
card.x = options.x
card.y = options.y
View gradient.lua
local paint = {
type = 'gradient',
color2 = {colorize('#ffffff')},
color1 = {colorize('#00B0FF')},
direction = 'down'
}
local rect = display.newRect(self.view, W / 2, H / 2, W, H)
rect.fill = paint
View dark-slack.js
// First make sure the wrapper app is loaded
document.addEventListener('DOMContentLoaded', function() {
// Then get its webviews
let webviews = document.querySelectorAll('.TeamView webview');
// Fetch our CSS in parallel ahead of time
const cssPath =
'https://raw.githubusercontent.com/Nockiro/slack-black-theme/3ea2efdfb96ccc91549837ab237d57104181bbf8/custom.css';
let cssPromise = fetch(cssPath).then(response => response.text());
View alternate-vertical-positioning.lua
local alternate = require 'cherry.libs.alternate'
self.buttons = {}
for i = 1, #keys do
self.buttons[#self.buttons + 1] =
createButton({
name = 'button-' .. i,
parent = scroller,
x = display.contentWidth / 2 + alternate(i) * 100,
View corona-stutter.lua
local spaceship = display.newGroup()
App.hud:insert(spaceship)
spaceship.y = display.contentHeight - 100
spaceship.x = display.contentWidth * 0.5
local image = display.newImage(
spaceship,
'assets/images/game/spaceship.png',
0, 0
)
@chrisdugne
chrisdugne / scale-and-center.md
Last active Feb 7, 2019
github: scale and align image
View scale-and-center.md
<p align="center">
  <img 
    src="https://user-images.githubusercontent.com/910636/52334105-3be87480-29ff-11e9-9249-0981514d320d.gif" 
    width="300"
  >
</p>
@chrisdugne
chrisdugne / sync-local-deps.sh
Last active May 24, 2019
coorp/mobile/scripts/sync-local-deps.sh
View sync-local-deps.sh
echo "[sync-local-deps] -------------------"
echo "[sync-local-deps] progression-engine"
echo "[sync-local-deps] -------------------"
echo "[sync-local-deps] transpiling progression-engine/lib"
cd $LERNA/packages/@coorpacademy-progression-engine
npm run build:commonjs
echo "[sync-local-deps] synchronizing progression-engine/lib"
cd $MOBILE
rm -rf node_modules/@coorpacademy/progression-engine/lib/
cp -r $LERNA/packages/@coorpacademy-progression-engine/lib node_modules/@coorpacademy/progression-engine
View list-files.lua
local lfs = require ( "lfs" )
function showFolder(folder)
print('===================== ' .. folder)
local path = system.pathForFile( folder, system.ResourceDirectory )
for file in lfs.dir ( path ) do
print (file)
end
end
@chrisdugne
chrisdugne / github-xstyle.css
Last active Sep 9, 2019
my GitHub Darkside of the Moon Theme
View github-xstyle.css
@-moz-document domain(github.com) {
body {
background-color: #2A2C2F;
color: #E6E6E6;
}
a {
color: #72B0FF;
}
.social-count {
background: #212225;
You can’t perform that action at this time.