Skip to content

Instantly share code, notes, and snippets.

View basilbeltran's full-sized avatar

Basil Beltran basilbeltran

View GitHub Profile

#DaftPunKonsole

A console to recreate the famous "Harder, Better, Faster, Stronger" by Daft Punk. Use your keyboard ! not the mouse (hey, it's a console). Use the other keys to get different sounds (Normal, High, Low). You can do it !

Forked from Malik Dellidj's Pen #DaftPunKonsole.

A Pen by Florian Wartner on CodePen.

@basilbeltran
basilbeltran / iTermAppleScript
Created October 27, 2018 04:37
run iterm with start commands
#!/bin/bash
read -r -d '' script <<'EOF'
on run argv
tell application "iTerm"
activate
set myterm to (make new terminal)
tell myterm
launch session "Default"
tell the last session
repeat with arg in argv
@basilbeltran
basilbeltran / header.html
Last active October 26, 2018 16:37
Three.js-libs
   <link rel="import" href="../assets/js/dist/paper-gui.html">
   <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/97/three.js"></script>
   <script src="../assets/libs/OrbitControls.js"></script>    
   <script src="../assets/libs/TrackballControls.js"></script>
   <script src="../assets/libs/jquery-3.1.0.js"></script>
   <script src="../assets/libs/dat.gui.min.js"></script>
<!-- <script src="../assets/libs/three.js"></script> -->
@basilbeltran
basilbeltran / README.md
Created October 17, 2018 22:51 — forked from robschmuecker/README.md
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@basilbeltran
basilbeltran / datgui-build.js
Created October 17, 2018 22:41 — forked from heaversm/datgui-build.js
Automatically build a dat gui from a javascript object
config = { //SAMPLE OBJECT - replace this with your data object
stroke: 2, //svg stroke value
opacity: 0.3, //0-1
offsetX: 120, //px
offsetY: 80,
fontWeight: 400, //css font-weight
fontSize: 12, //in px
changePositive: '\u25B4', //unicode character for up arrow
changeNegative: '\u25BE', //unicode character for down arrow
colorBlue: '#1190A3', //all hex colors will automatically use the addColor dat gui function
@basilbeltran
basilbeltran / datgui-build.js
Created October 17, 2018 22:41 — forked from heaversm/datgui-build.js
Automatically build a dat gui from a javascript object
config = { //SAMPLE OBJECT - replace this with your data object
stroke: 2, //svg stroke value
opacity: 0.3, //0-1
offsetX: 120, //px
offsetY: 80,
fontWeight: 400, //css font-weight
fontSize: 12, //in px
changePositive: '\u25B4', //unicode character for up arrow
changeNegative: '\u25BE', //unicode character for down arrow
colorBlue: '#1190A3', //all hex colors will automatically use the addColor dat gui function
@basilbeltran
basilbeltran / States
Created August 7, 2015 04:55
Android State Transitions
private static final String KEY_VAL = "valofit";
private static final String KEY_TRUE = "isittrue";
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
mCurrentVal = savedInstanceState.getInt(KEY_VAL, 0);
mIsTrue = savedInstanceState.getBoolean(KEY_TRUE, false);
public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState);
savedInstanceState.putInt(KEY_VAL, mCurrentVal);
@basilbeltran
basilbeltran / MISC CMD LINE
Last active August 29, 2015 14:26
misc android blocks
android:theme="@android:style/Theme.Holo">
Toast.makeText(getContext(), text/resId, Toast.LENGTH_SHORT).show();
$ ./gradlew tasks
$ ./gradlew installDebug
@basilbeltran
basilbeltran / Options
Last active August 29, 2015 14:26
ActionBar Options
extends ListFragment {
private boolean mSubtitleVisible; //instance vbl retained
onCreate...
setHasOptionsMenu(true); //Fragment will be implementing options menu callbacks on behalf of the activity.
setRetainInstance(true); //retain
mSubtitleVisible = false; //retain is for preserving menu state through rotation event
@TargetApi(11) // if ( minSdk < API < 11) !Lint; you have accounted for VERSION_CODE and under
onCreateView...