Skip to content

Instantly share code, notes, and snippets.

View adekbadek's full-sized avatar

Adam Cassis adekbadek

View GitHub Profile
@adekbadek
adekbadek / showedgecollider.cs
Last active December 30, 2023 19:02
Show 2D Edge Collider as Gizmo, also in Edit Mode
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class visibleCollider : MonoBehaviour {
// The Collider itself
private EdgeCollider2D thisCollider;
// array of collider points
private Vector2[] points;
module.exports = function(grunt) {
grunt.initConfig({
// (...)
copy:{
// (...)
options: {
process: function (content) {
content = content.replace(/<!-- DEVELOPMENT -->\s*.*\s*<!-- END DEVELOPMENT -->/g,'');
content = content.replace(/<!-- PRODUCTION\s*(.*)\s*END PRODUCTION -->/g, '$1');
return content;
<!-- DEVELOPMENT -->
<script type="text/javascript" src="js/script.js" ></script>
<!-- END DEVELOPMENT -->
<!-- PRODUCTION
<script type="text/javascript" src="js/script.min.js"></script>
END PRODUCTION -->
module.exports = function(grunt) {
// most basic Grunt config with just livereloading
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
html: {
files: 'index.html',
// Print n lines of Pascal's triangle
function new_line(line){
// function takes the last line and based on that creates the next one
var new_line_array = [],
next_int;
// iterate over the line, which is an array of integers
for(var i=0; i<line.length; i++ ){
var a = parseInt(line[i]);
var b = parseInt(line[i-1]);
@adekbadek
adekbadek / screenshots.coffee
Last active January 26, 2016 13:09 — forked from nhoizey/screenshots.js
Take screenshots at different viewport sizes using CasperJS
###
# Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
# These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
#
# Original gist by nhoizey: https://gist.github.com/nhoizey/4060568
#
# Usage:
# $ casperjs screenshots.coffee [--atf] [--url=URL]
# with SlimerJS - it has better feature support than the default PhantomJS
# $ casperjs --engine=slimerjs test.coffee [--atf] [--url=URL]
// Print n lines of Pascal's triangle
// just a factorial function
function fa(num) {
if (num === 0){ return 1; }
else{ return num * fa( num - 1 ); }
}
// Binomial coefficient
function newt(n, k){
// in each paragraph, add a 24h-formatted time and convert from EST to Central Europe time.
// BEWARE between Mar 13 and Mar 26 USA already change to DST, while Poland still waits. Next funkyzeit in Nov.
$('p').each(function(){
var match = $(this).html().match(/([\w]*):([\w]*) ([\w]*)/)
if(match != null && match.length >= 0){
var h = match[1]
var m = match[2]
var ap = match[3]
const a = 'abcdefghijklmnopqrstuvwxyz'
const ceasar = (str, rot) => {
return str.split('').map((letter) => {
if (a.indexOf(letter.toLowerCase()) < 0) {
return letter
}
let rotLetter = a[(a.indexOf(letter.toLowerCase()) + rot) % a.length]
return letter.toLowerCase() === letter ? rotLetter : rotLetter.toUpperCase()

Keybase proof

I hereby claim:

  • I am adekbadek on github.
  • I am adamboro (https://keybase.io/adamboro) on keybase.
  • I have a public key whose fingerprint is 0184 5B0B 5DA3 FC5F B7A6 1B2B EAD0 EECF FEF4 E0A3

To claim this, I am signing this object: