Skip to content

Instantly share code, notes, and snippets.

View pascalbaljet's full-sized avatar

Pascal Baljet pascalbaljet

View GitHub Profile
@jareware
jareware / SCSS.md
Last active February 13, 2024 14:33
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@mekya
mekya / GoProStreamer.java
Created January 30, 2015 04:19
GoPro Hero4 Silver - Live Preview on PC (java, ffplay, ffmpeg)
import java.io.IOException;
import java.io.InputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.net.URL;
import java.util.Locale;
@Vestride
Vestride / encoding-video.md
Last active March 12, 2024 16:41
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@ftvs
ftvs / PhonecallReceiver.java
Last active October 11, 2023 10:05
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@calebporzio
calebporzio / fa.sublime_snippet
Last active April 8, 2018 01:34
Font Awesome sublime snippet for creating icon tags
<snippet>
<content><![CDATA[
<i class="fa fa-fw fa-${1}"></i>&nbsp;
]]></content>
<tabTrigger>fa</tabTrigger>
<description>Font Awesome Icon</description>
<scope>text.blade, text.html.blade, text.html</scope>
</snippet>
const express = require('express');
const app = express();
// Application
app.get('/', function(req, res) {
if (process.env.NODE_ENV === 'development') {
for (var key in require.cache) {
delete require.cache[key];
}
}
@tonysm
tonysm / concurrent-pool.php
Last active November 1, 2023 13:08
Concurrent Requests
<?php
// 1. Register the routes
Route::get('test/{lorem}', function ($lorem) {
sleep(3);
return response()->json([
'message' => $lorem,
'token' => Str::random(),
]);
@ninthspace
ninthspace / Controller.php
Last active April 15, 2021 17:19
Time travel with Dusk without pesky JavaScript
<?php
// update Controller.php as follows
namespace App\Http\Controllers;
use App\Services\TimeTravel;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;