Skip to content

Instantly share code, notes, and snippets.

View luckytuvshee's full-sized avatar
💻
Focusing

Tuvshinsanaa Tuul luckytuvshee

💻
Focusing
View GitHub Profile
install these packages before running "configure" script
you can uninstall these packages once "make install" is done
libncursesw5-dev (for supporting wide characters such as Åå Ää Öö)
libopusfile-dev
libsystemd-dev
libavformat-dev
libpulse-dev
jack
libroar-dev
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@jacurtis
jacurtis / 1) Main.blade.php
Created February 16, 2017 16:37
Laravel 5.4 Components & Slots
<!-- This is the main Blade file that you want your components to show up in -->
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
@joshbeckman
joshbeckman / animatedScrollTo.js
Created September 30, 2013 14:51
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@Plou
Plou / projectName.local.plou
Created June 18, 2013 21:23
a virtual host example, Access-Control-Allow-Origin set to allow any request from foreign domains
## projectName
<VirtualHost *:80>
ServerName projectName.local.plou
CustomLog "/www/.logs/projectName.local.plou-access_log" combined
ErrorLog "/www/.logs/projectName.local.plou-error_log"
DocumentRoot "/www/projectName/"
Header set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, PUT, GET, DELETE, OPTIONS"
Header always set Access-Control-Allow-Headers "Content-Type"
</VirtualHost>
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git