Skip to content

Instantly share code, notes, and snippets.

Christian Castelli chrisvoo

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
mpj / example01.js
Created Aug 14, 2017
Code for the async/await episode of Fun Fun Function.
View example01.js
const response = await fetch(`https://catappapi.herokuapp.com/users/${userId}`)
const data = await response.json()
return data.imageUrl
}
@sam-artuso
sam-artuso / setting-up-babel-nodemon.md
Last active Aug 12, 2019
Setting up Babel and nodemon
View setting-up-babel-nodemon.md

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@eridal
eridal / Compiler.java
Last active Aug 29, 2015
Java to PHP Compilation
View Compiler.java
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
myusuf3 / delete_git_submodule.md
Created Nov 3, 2014
How effectively delete a git submodule.
View delete_git_submodule.md

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
@metrofx
metrofx / glog
Created Feb 12, 2014
Pretty git log, displays 20 last commits.
View glog
#!/bin/sh
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
debasishg / gist:8172796
Last active Aug 16, 2019
A collection of links for streaming algorithms and data structures
View gist:8172796
  1. General Background and Overview
@gmccreight
gmccreight / master.vim
Last active Jul 21, 2019
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
bgrins / Log-.md
Last active Jul 27, 2019
Prevent errors on console methods when no console present and expose a global 'log' function.
View Log-.md

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">
<head>
<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.