Skip to content

Instantly share code, notes, and snippets.

hard as a rock

Christian Castelli chrisvoo

hard as a rock
Block or report user

Report or block chrisvoo

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
mpj / example01.js
Created Aug 14, 2017
Code for the async/await episode of Fun Fun Function.
View example01.js
const response = await fetch(`${userId}`)
const data = await response.json()
return data.imageUrl
sam-artuso /
Last active May 25, 2020
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
eridal /
Last active Aug 29, 2015
Java to PHP Compilation
package j2p;
import japa.parser.JavaParser;
import japa.parser.ParseException;
import japa.parser.ast.CompilationUnit;
import japa.parser.ast.ImportDeclaration;
import japa.parser.ast.PackageDeclaration;
import japa.parser.ast.body.BodyDeclaration;
import japa.parser.ast.body.ClassOrInterfaceDeclaration;
import japa.parser.ast.body.FieldDeclaration;
myusuf3 /
Created Nov 3, 2014
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
mindplay-dk / rm_r.php
Last active Apr 27, 2020
Recursively delete a directory and all of it's contents - USE AT YOUR OWN RISK!
View rm_r.php
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use SplFileInfo;
* Recursively delete a directory and all of it's contents - e.g.the equivalent of `rm -r` on the command-line.
metrofx / glog
Created Feb 12, 2014
Pretty git log, displays 20 last commits.
View glog
git --no-pager log -n 20 --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
debasishg / gist:8172796
Last active May 23, 2020
A collection of links for streaming algorithms and data structures
View gist:8172796
  1. General Background and Overview
gmccreight / master.vim
Last active Mar 7, 2020
A script that gives you a playground for mastering vim
View master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
bgrins /
Last active Feb 2, 2020
Prevent errors on console methods when no console present and expose a global 'log' function.

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
View soundcloud_oauth2_user_agent_authentication_flow_demo.html
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
You can’t perform that action at this time.