Skip to content

Instantly share code, notes, and snippets.

@yannbertrand
yannbertrand / index.css
Last active October 2, 2016 09:00
Electron drag macOS
html,
body {
padding: 0;
margin: 0;
}
body {
font-family: -apple-system, 'Helvetica Neue', Helvetica, sans-serif;
-webkit-app-region: drag;
}
@yannbertrand
yannbertrand / gulpfile.js
Created September 11, 2016 15:48
Issue #58 electron-connect
const gulp = require('gulp');
const babel = require('gulp-babel');
const debug = require('gulp-debug');
const cache = require('gulp-cached');
const plumber = require('gulp-plumber');
const notify = require("gulp-notify");
const electron = require('electron-connect').server.create();
const errorTemplate = '<%= error.message %>';
@yannbertrand
yannbertrand / DatepickerDirective.js
Created August 24, 2016 13:16
An Angular datepicker directive (angular-ui-bootstrap datepicker overlay)
(function () {
'use strict';
angular.module('solisPaiementApp.directives')
.directive('myDatepicker', ['$timeout', function ($timeout) {
return {
restrict: 'A',
require: ['^?form', 'ngModel'],
scope: {
@yannbertrand
yannbertrand / Preferences.sublime-settings
Last active November 14, 2016 21:40
My Sublime Text's user preferences settings
{
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"folder_exclude_patterns":
[
"dist",
"node_modules",
".git"
],
"font_options":
[
@yannbertrand
yannbertrand / autoexec.cfg
Last active January 30, 2022 01:11
CS:GO autoexec file
//C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg
cl_autowepswitch "0" // we dont want to pick up & switch to a rifle up if we're in the middle of firing
cl_disablefreezecam "1"
cl_downloadfilter "nosounds"
cl_disablehtmlmotd "1" // Disables The Servers Message of The Day.
cl_forcepreload "1" // Preloads The Whole Map & Sounds.
https://www.linux.com/community/blogs/133-general-linux/850945-setup-mutt-with-gmail-on-centos-and-ubuntu
# Setup a service in /etc/init.d
https://www.debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian
# Don't forget the LSB tags
http://help.directadmin.com/item.php?id=379
# Example on a script called blah:
$ update-rc.d blah defaults
@yannbertrand
yannbertrand / debian-check-open-ports
Created February 18, 2016 09:11
List open ports and check one is up
# /!\ May change whether root or not
netstat -pln [| grep PORT_NB]
@yannbertrand
yannbertrand / better-index-of.js
Created January 18, 2016 10:15
Simplify the use of indexOf
// Array
var list = ['my', 'str', 'list'];
if (~list.indexOf('my')) {
console.log('the `list` array contains \'my\'');
}
if (!~list.indexOf('number')) {
console.log('the `list` array does not contain \'number\'');
}
@yannbertrand
yannbertrand / angular-bullshit.js
Last active June 13, 2018 17:48
Bullshit code from Angular
$resource(a, b, {
getSomething: {
method: 'GET',
url: baseUrl + ':id' // work if you pass the `id` param in the parameters object
},
postSomething: {
method: 'POST',
url: baseUrl + ':id', // you need to add the next line to make it work for post requests (didn't try with other verbs)
params: { id: '@id' }
}