Skip to content

Instantly share code, notes, and snippets.

View Londeren's full-sized avatar
💭
Building a rocket 🚀

Sergey Lebedev Londeren

💭
Building a rocket 🚀
View GitHub Profile
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@mauris
mauris / queue-ensure.php
Created April 28, 2014 15:44
Laravel Artisan Queue Ensurer - Set a cron job to run this file periodically to ensure that Laravel's queue is processing all the time. If the queue listener stopped, restart it!
<?php
function runCommand ()
{
$command = 'php artisan queue:listen > /dev/null & echo $!';
$number = exec($command);
file_put_contents(__DIR__ . '/queue.pid', $number);
}
if (file_exists(__DIR__ . '/queue.pid')) {
@staltz
staltz / introrx.md
Last active June 18, 2024 06:15
The introduction to Reactive Programming you've been missing
@terrywbrady
terrywbrady / GoogleSpreadsheet.html
Last active May 17, 2024 07:17
Sample HTML/JS to parse a Google Spreadsheet
<!doctype html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var spData = null;
function doData(json) {
spData = json.feed.entry;
}
@maxxscho
maxxscho / homestead-base-setup.md
Last active February 19, 2020 10:36
Homestead Base Setup

Timezone

  1. Check your current timezone with date in the command line. You should get something like this. Fri Oct 3 10.32:13 UTC 2014 where UTC is your current timezone.
  2. To change your timezone just run sudo dpkg-reconfigure tzdata and follow the instructions. Easy!
  3. Check the timezone again with date. Now your timezone should be in this example CEST

Locale

Homestead provides an Ubuntu System and has by default only english locales installed. In PHP locales are important if you work for example with strftime. Check the currently installed locales with locale -a. To add a new locale, you have to generate it. For example for a german locale enter sudo locale-gen de_DE.UTF-8

@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active June 1, 2024 09:44
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@maxtruxa
maxtruxa / Antonyms.md
Last active June 18, 2024 18:39
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
@developit
developit / _preact-pure-component.md
Created September 7, 2016 14:14
pure-component for Preact

pure() can be used as a higher order function or a decorator.

When passed a pure functional component, it wraps the function in a classful Component with a shouldComponentUpdate() that ignores renders for unchanged props.

When passed a classful Component, it injects a shouldComponentUpdate() method into the Component's prototype that ignores renders for unchanged props & state.

Functional Example

import pure from 'pure-component';
@jacurtis
jacurtis / _spacing-helpers.scss
Last active May 30, 2024 17:41
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 20, 2024 23:48
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example