Skip to content

Instantly share code, notes, and snippets.

@gregz67
gregz67 / skittles.js
Created November 12, 2015 18:00
HackerRank quiz
/**
We need to deliver a package of Skittles bags. You will be given an inventory of small bags (1 kilo each) and big bags
(5 kilos each) along with the goal amount of kilos we need to ship the customer. Return the amount of small bags the package
will contain assuming we always use big bags first. Return -1 if it cannot be done.
Input
small (type: int) - The number of small bags we have to work with
big (type: int) - The number of big bags we have to work with
goal (type: int) - The goal weight of the package that we need to ship out
@facelordgists
facelordgists / CopyConsole
Last active December 20, 2016 17:24
Setup Barracuda Copy Console on Ubuntu 14.04 & ServerPilot
#!/bin/sh
# CopyConsole (Copy cloud storage by Barracuda) service
copyConsolePath="/srv/users/serverpilot/scripts/copy/CopyConsole"
copyUser="serverpilot"
userHomeDir="/srv/users/serverpilot"
start() {
echo "Starting CopyConsole..."
if [ -x $copyConsolePath ]; then
@josefnpat
josefnpat / readme.md
Last active March 25, 2026 21:05
Going from Lua 5.2 to PICO-8's Lua

This information applies to the PICO-8 0.1.6 release.

This document is here to help folks with a proficiency in Lua understand the limitations and discrepencies between Lua and PICO-8's Lua.

You can always view the manual or yellowafterlife's extended 0.1.1 manual.

General

  • anything written in uppercase the PICO-8 editor or .p8 is made lowercase by the editor. → editing the .p8 file directly can work
  • print(function() end) outputs the string function instead of the string function: 0x0000000.
@facelordgists
facelordgists / vc-legacy-class-remap.php
Last active October 13, 2015 22:12
Remap Visual Composer 4.3.x and newer CSS column class names back to legacy class names
<?php
/*
Plugin Name: Visual Composer Legacy Class Remapper
Description: Remap Visual Composer (4.3.x and newer) CSS column & row class names back to legacy (4.2.x and older) class names
Version: 1.0.0
Author: Milo Jennings
License: GPL2
Plugin URI: https://gist.github.com/1b0b602432175937f658
*/
@ruario
ruario / get-vivaldi-snap.sh
Last active December 24, 2017 00:31
Fetches the latest Vivaldi Linux rpm or deb package listed on the team blog
#!/bin/sh
case ${ARCH:-$(uname -m)} in
x86_64) DEBARCH=amd64; ARCH=x86_64 ;;
i?86) DEBARCH=i386; ARCH=i386 ;;
*) echo "Your architecture is not supported!" >&2; exit 1 ;;
esac
if [ "$1" = "-d" ]; then
PKGTYPE=deb
ARCH=$DEBARCH
@facelordgists
facelordgists / get-directory-via-sftp.sh
Last active August 29, 2015 14:28
SFTP using LFTP w/ fancy options
#!/bin/bash
# usage:
# sh get-directory-via-sftp.sh hostname:port username password source_folder destination_folder
# sh get-directory-via-sftp.sh example.com:2222 awesome_user Ultra-pw-9000 /remote-folder-name ~/Downloads/
# This will copy /remote-folder-name to ~/Downloads/remote-folder-name
HOST=$1
USER=$2
PASS=$3
@ryanpcmcquen
ryanpcmcquen / install-right-click-imgult-mac.sh
Last active October 14, 2016 13:39
install-right-click-imgult-mac.sh
#!/bin/sh
## curl https://gist.githubusercontent.com/ryanpcmcquen/2cb42266052a57992d55/raw/install-right-click-imgult-mac.sh | sh
cd
## Get the command line tools!
xcode-select --install
## You have to do this:
@ryanpcmcquen
ryanpcmcquen / index.html
Last active August 29, 2015 14:17
gisto-plnkr-template
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<!-- start the fun -->
@facelordgists
facelordgists / factory-2.0-field-definitions.json
Created March 18, 2015 22:53
Factory 2.0 DMS field definitions
{"fields":[
{
"title":"Icon",
"token":"icon",
"type":"select_icon",
"help":"Font Awesome Icon",
"default":"fa fa-heart"
},
{
"title":"Heading",
@facelordgists
facelordgists / less-color-classes.less
Last active August 29, 2015 14:17
Use LESS to generate class selectors for text, background, border, and link using a mixin.
@color-primary: #f50;
@color-secondary: #ccf;
@pumpkin: #fa7500;
#theme-color-mixin(@color, @class) {
.@{class}{color: @color}
.@{class}i{color: @color !important}
.@{class}-bg{background-color:@color}
.@{class}-bgi{background-color:@color !important}