This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using Unity.Mathematics; | |
public class Noise : MonoBehaviour { | |
public int width; | |
public int height; | |
public float scaleX; | |
public float scaleY; | |
public float offsetX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
multiline() { | |
read -r -d '' "$@" | |
} | |
multiline text << 'END' | |
Hello, world! | |
Multiline docstrings seems to work today... |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
API_TOKEN = 'XXX' | |
CAMPAIGN_ID = 'XXX' | |
def get_page(url, headers): | |
result = requests.get(url, headers=headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raw.githack.com is working! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Bootstrap file for (re)creating database before running tests | |
* | |
* You only need to put this file in "bootstrap" directory of the project | |
* and change "bootstrap" phpunit parameter within "phpunit.xml" | |
* from "bootstrap/autoload.php" to "bootstap/testing.php" | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local m = {} | |
m.mods = {} | |
function m.mtime(filepath) | |
local info = love.filesystem.getInfo(filepath) | |
return info and info.modtime | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Lazy Paginator for Laravel | |
* Does not use number of pages, simply shows First, Previous and Next links | |
* | |
* Usage: | |
* $pager = LazyPaginator( | |
* Model::where_field($field), // Eloquent, Fluent Query or array of objects | |
* Model::$per_page, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On Debian, you need to install these packages: | |
# jpegoptim optipng pngcrush advancecomp | |
import subprocess | |
from os.path import splitext | |
from django.dispatch import receiver | |
from easy_thumbnails.signals import saved_file, thumbnail_created | |
# on-save image optimization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var GoL = function () { | |
function touch(ctx, x, y, alive) { | |
ctx[alive ? 'fillRect' : 'clearRect'](x * 11, y * 11, 10, 10); | |
return alive; | |
} | |
function renderDiff(ctx, diff) { | |
for (var d of diff) touch(ctx, d[0], d[1], d[2]); |
NewerOlder